# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: Hoàng Đức Hiếu <arch@zahe.me>
# Contributor: Fernando
# Contributor: Manfred Sauter
# Contributor: Marcos Heredia <chelqo@gmail.com>

pkgname=diffpdf
pkgver=2.1.3.1
pkgrel=3
pkgdesc="Diffing pdf files visually or textually"
url="https://gitlab.com/eang/diffpdf"
license=('GPL2')
arch=('loong64' 'x86_64')
depends=('poppler-qt5' 'hicolor-icon-theme')
makedepends=('cmake' 'extra-cmake-modules' 'qt5-tools')
source=("https://gitlab.com/eang/diffpdf/-/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz")
sha512sums=('9213fc8ee9d568ad97824d30de1ffb137c30c58935f8a19e19690e956cd4db1a0c6020d0543f76ca1b4ca8858d7ce9329544bda6a68b943b00e1a581cdb1ed41')

build() {
  cd ${pkgname}-v${pkgver}/
  cmake -D CMAKE_INSTALL_PREFIX="/usr" .
  make
}

package() {
  cd ${pkgname}-v${pkgver}/
  make DESTDIR="${pkgdir}" install

  install -dm755 "${pkgdir}"/usr/share/${pkgname}/translations
  install -Dm644 *.qm "${pkgdir}"/usr/share/${pkgname}/translations
  install -Dm644 gpl-2.0.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
